<template>
  <div id="app">
    <el-dialog
      title="温馨提示"
      top="30vh"
      :visible.sync="tipShow"
      width="30%"
      center
    >
      <span
        >为保护个人隐私信息，系统自动对敏感数据进行脱敏。如需编辑、查看完整信息，可通过“用户隐私二次认证”功能进行验证，验证通过之后，24小时内可查看完整信息。</span
      >
      <span slot="footer" class="dialog-footer">
        <el-button @click="tipShow = false">关闭</el-button>
      </span>
    </el-dialog>
    <router-view />
  </div>
</template>

<script>
import { getPrivacySwitch } from '@/api/privacy'
import { getLoginUser } from '@/tim'
import { initTIM, eventlist, loginIM } from '@/tim/imUtils.js'
import * as MessageStoreUtil from '@/store/message/MessageStoreUtil.js'
export default {
  name: 'App',
  data () {
    return {
      tipShow: false,
    }
  },
  created () {
    var self = this
    if (this.$store.state.user.token) {
      this.getPrivacySwitch()
    }
    // initTIM().then(res => {
    //   self.initFlow()
    //   // im login
    // })
  },
  methods: {
    getPrivacySwitch () {
      getPrivacySwitch().then((res) => {
        var IsTipshow = localStorage.getItem('IsTipshow')
        localStorage.setItem('privacyTime', res.data)
        if (this.$store.state.user.token && !IsTipshow && res.data === 0) {
          this.tipShow = true
          localStorage.setItem('IsTipshow', true)
        }
      })
    },
    initFlow () {
      //  进入系统在sessIOn获取登陆状态
      var currentUser = getLoginUser()
      if (currentUser && currentUser.businessUserId) {
        MessageStoreUtil.set_currentUser(currentUser)
      }
    },
  },
};
</script>
<style lang="scss">
.el-dialog__header {
  background-color: #3a68f2;
  text-align: left;
}

.el-dialog__title {
  color: #ffffff;
}

.row-gap-2 {
  row-gap: 20px;
}
.column-gap-2 {
  column-gap: 20px;
}
.column-gap-1 {
  column-gap: 10px;
}
.mb-4 {
  margin-bottom: 4px;
}
.flex {
  display: flex;
}
.justify-start {
  justify-content: flex-start;
}
.item-center {
  align-items: center;
}
</style>
